<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: D:/Projects/MiXiM/extsrc/mixim/src/base/modules/BaseBattery.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00266.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">BaseBattery.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef BASE_BATTERY_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define BASE_BATTERY_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;omnetpp.h&gt;</span>
<a name="l00005"></a>00005 
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;MiXiMDefs.h&quot;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &quot;BaseModule.h&quot;</span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;HostState.h&quot;</span>
<a name="l00009"></a>00009 
<a name="l00025"></a><a class="code" href="a00087.html">00025</a> <span class="keyword">class </span>MIXIM_API <a class="code" href="a00087.html" title="Defines the amount of power drawn by a device from a power source.">DrawAmount</a> {
<a name="l00026"></a>00026 <span class="keyword">public</span>:
<a name="l00028"></a><a class="code" href="a00087.html#ae388439d3e21c30f465e2563199bbec4">00028</a>   <span class="keyword">enum</span> <a class="code" href="a00087.html#ae388439d3e21c30f465e2563199bbec4" title="The type of the amount to draw.">PowerType</a> {
<a name="l00029"></a>00029     CURRENT,  
<a name="l00030"></a><a class="code" href="a00087.html#ae388439d3e21c30f465e2563199bbec4ad8fe7930899c36833e603cd89446d86f">00030</a>     ENERGY    
<a name="l00031"></a>00031   };
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="keyword">protected</span>:
<a name="l00035"></a><a class="code" href="a00087.html#ad7d65a7c37b7f2b4b48de40fd4e6bc0e">00035</a>   <span class="keywordtype">int</span> <a class="code" href="a00087.html#ad7d65a7c37b7f2b4b48de40fd4e6bc0e" title="Stores the type of the amount.">type</a>;
<a name="l00036"></a>00036 
<a name="l00038"></a><a class="code" href="a00087.html#a5e5e81c528b00da622e79a04d603d4c4">00038</a>   <span class="keywordtype">double</span> <a class="code" href="a00087.html#a5e5e81c528b00da622e79a04d603d4c4" title="Stores the actual amount.">value</a>;
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 <span class="keyword">public</span>:
<a name="l00042"></a><a class="code" href="a00087.html#a29f037ed6bda2e8aad742a9fb9cfec07">00042</a>   <a class="code" href="a00087.html" title="Defines the amount of power drawn by a device from a power source.">DrawAmount</a>(<span class="keywordtype">int</span> type = CURRENT, <span class="keywordtype">double</span> value = 0):
<a name="l00043"></a>00043     type(type),
<a name="l00044"></a>00044     value(value)
<a name="l00045"></a>00045   {}
<a name="l00046"></a>00046   <span class="keyword">virtual</span> ~<a class="code" href="a00087.html" title="Defines the amount of power drawn by a device from a power source.">DrawAmount</a>()
<a name="l00047"></a>00047   {}
<a name="l00048"></a>00048 
<a name="l00050"></a><a class="code" href="a00087.html#a8cf70f5a3603f1c6e2936cfa4acdc1b9">00050</a>   <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a00087.html#a8cf70f5a3603f1c6e2936cfa4acdc1b9" title="Returns the type of power drawn as PowerType.">getType</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> type; }
<a name="l00052"></a><a class="code" href="a00087.html#ac3d6a9f36fb6f7d3141d4d28f64cf701">00052</a>   <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="a00087.html#ac3d6a9f36fb6f7d3141d4d28f64cf701" title="Returns the actual amount of power drawn.">getValue</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> value; }
<a name="l00053"></a>00053 
<a name="l00055"></a><a class="code" href="a00087.html#a7fffdcf0b57e6b1609f16351e9d4dad0">00055</a>   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00087.html#a7fffdcf0b57e6b1609f16351e9d4dad0" title="Sets the type of power drawn.">setType</a>(<span class="keywordtype">int</span> t) { type = t; }
<a name="l00057"></a><a class="code" href="a00087.html#a8e411a80838eea09c6b38bc232e902ff">00057</a>   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00087.html#a8e411a80838eea09c6b38bc232e902ff" title="Sets the actual amount of power drawn.">setValue</a>(<span class="keywordtype">double</span> v) { value = v; }
<a name="l00058"></a>00058 };
<a name="l00059"></a>00059 
<a name="l00069"></a><a class="code" href="a00018.html">00069</a> <span class="keyword">class </span>MIXIM_API <a class="code" href="a00018.html" title="Base class for any power source.">BaseBattery</a> : <span class="keyword">public</span> <a class="code" href="a00027.html" title="Base class for all simple modules of a host.">BaseModule</a> {
<a name="l00070"></a>00070 <span class="keyword">private</span>:
<a name="l00073"></a>00073   <a class="code" href="a00018.html" title="Base class for any power source.">BaseBattery</a>(<span class="keyword">const</span> <a class="code" href="a00018.html" title="Base class for any power source.">BaseBattery</a>&amp;);
<a name="l00076"></a>00076   <a class="code" href="a00018.html" title="Base class for any power source.">BaseBattery</a>&amp; <a class="code" href="a00027.html#ac5c54f656cb8c9b794060b2d88d5a161" title="Assignment operator is not allowed.">operator=</a>(<span class="keyword">const</span> <a class="code" href="a00018.html" title="Base class for any power source.">BaseBattery</a>&amp;);
<a name="l00077"></a>00077 
<a name="l00078"></a>00078 <span class="keyword">public</span>:
<a name="l00079"></a>00079   <a class="code" href="a00018.html" title="Base class for any power source.">BaseBattery</a>() : <a class="code" href="a00027.html" title="Base class for all simple modules of a host.">BaseModule</a>()
<a name="l00080"></a>00080   {}
<a name="l00081"></a>00081   <a class="code" href="a00018.html" title="Base class for any power source.">BaseBattery</a>(<span class="keywordtype">unsigned</span> stacksize) : <a class="code" href="a00027.html" title="Base class for all simple modules of a host.">BaseModule</a>(stacksize)
<a name="l00082"></a>00082   {}
<a name="l00094"></a>00094   <span class="keyword">virtual</span> <span class="keywordtype">int</span> registerDevice(<span class="keyword">const</span> std::string&amp; name, <span class="keywordtype">int</span> numAccounts) = 0;
<a name="l00095"></a>00095 
<a name="l00107"></a>00107   <span class="keyword">virtual</span> <span class="keywordtype">void</span> draw(<span class="keywordtype">int</span> drainID, <a class="code" href="a00087.html" title="Defines the amount of power drawn by a device from a power source.">DrawAmount</a>&amp; amount, <span class="keywordtype">int</span> account) = 0;
<a name="l00108"></a>00108 
<a name="l00118"></a>00118   <span class="keyword">virtual</span> <span class="keywordtype">double</span> getVoltage() <span class="keyword">const</span> = 0;
<a name="l00122"></a>00122   <span class="keyword">virtual</span> <span class="keywordtype">double</span> estimateResidualRelative() <span class="keyword">const</span> = 0;
<a name="l00124"></a>00124   <span class="keyword">virtual</span> <span class="keywordtype">double</span> estimateResidualAbs() <span class="keyword">const</span> = 0;
<a name="l00126"></a>00126   <span class="keyword">virtual</span> <a class="code" href="a00098.html#a5002302e0f07bbd982c6e5d65eaa9c3c" title="Possible host states.">HostState::States</a> getState() <span class="keyword">const</span> = 0;
<a name="l00128"></a>00128 };
<a name="l00129"></a>00129 
<a name="l00130"></a>00130 
<a name="l00131"></a>00131 
<a name="l00132"></a>00132 <span class="preprocessor">#endif</span>
<a name="l00133"></a>00133 <span class="preprocessor"></span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>BaseBattery.h</b>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:29 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
